Test case 1: [Snapshot testing] [Component] | - Renders donut chart with data.
| Donut chart renders correctly | Enzyme |
Test case 2: [Snapshot testing] [Individual Props] | Renders donut chart with: - HideTooltip prop set to “true”.
| Donut chart renders correctly | Enzyme |
| - HideLegend prop set to “true”.
| Donut chart renders correctly | Enzyme |
| - EnabledLegendsWrapLines prop set to “true”.
| Donut chart renders correctly | Enzyme |
| - ValueInsideDonut set to a string / number.
| Donut chart renders correctly | Enzyme |
| - HideLabels prop set to "false".
| Donut chart renders correctly | Enzyme |
| - HideLabels prop set to "false" and ShowLabelsInPercent prop set to "true".
| Donut chart renders correctly | Enzyme |
Test case 3: [Specific DOM elements] Renders individual elements on a prop change: | - HideLegend prop is set to “false”.
| Legend mounts correctly | Enzyme |
| - HideTootip prop is set to “false”.
| Callout mounts correctly | Enzyme |
| - onRenderCalloutPerStack prop is not given.
| Should not render onRenderCalloutPerStack | Enzyme |
| - onRenderCalloutPerDataPoint prop is given.
| Should render onRenderCalloutPerDataPoint correctly | Enzyme |
Test case 4: [Mouse events – Donut chart] Renders individual elements on mouse events: | - On mouse over on the donut chart.
| Should render callout | Enzyme |
| - On mouse move on Pie 1 (step 1) -> mouse leave (step 2) -> mouse move on Pie 2 (step 3).
| Html in step 1 should not be the same as in step 3 | Enzyme |
| - On mouse over with onRenderCalloutPerDataPoint prop provided.
| Should render the custom callout | Enzyme |
| - On mouse over, followed by mouse leave on callout.
| On mouse over, callout should be defined, on mouse leave, callout should disappear. | Enzyme |
Test case 5: [Mouse events – Legends] Renders individual elements on mouse events: | - On mouse over on legends.
| Should highlight the corresponding pie | RTL |
| - On mouse over on legends.
| Should change the value inside donut with the legend value | Enzyme |
| | Should highlight the corresponding pie with aria-selected set to “true” and tabIndex set to 0. | RTL |
| - On mouse out after mouse over on first legend.
| Should have opacity 0.1 for second Pie initially (during mouseOver on first legend) and opacity set to 1 for both the Pies on mouse out. | RTL |
Test case 6: [Keyboard events – Donut chart] Renders individual elements on keyboard events: | | Should render the corresponding callout | RTL |
| | Should remove focus from the corresponding Pie | RTL |